<template>
  <div class="container">
    <!-- 客户信息-片区信息 -->
    <el-tabs class="tabs-borderCard" v-model="activeName">
      <!-- <el-tab-pane label="册号管理" name="one">
        <regionalSetting />
      </el-tab-pane> -->
      <el-tab-pane label="小区管理" name="two">
        <!-- 查询条件 -->
        <el-form :inline="true" class="tableSearchBox" size="medium">
          <el-form-item label="小区名称：">
            <el-input v-model="search.villageName" placeholder="请输入小区名称" clearable></el-input>
          </el-form-item>
          <el-form-item>
            <el-button type="primary" icon="el-icon-search" @click="tablePagination.current=1;getVillage()">查询
            </el-button>
          </el-form-item>
          <el-form-item>
            <el-button type="primary" icon="el-icon-plus"
              @click="addVillageVisible = true;isAddVillage=true;clearFormInfo()">新增</el-button>
          </el-form-item>
        </el-form>
        <!-- /查询条件 -->
        <PagesTable :tableHeader="tableHeader" :tableData="tableData" :tableOperation="tableOperation"
          :tablePagination="tablePagination" @pageSize="pageSizeChange" @currentPage="currentPageChange"
          @pageOperation="handlePageOperation" />
      </el-tab-pane>
      <el-tab-pane label="片区管理" name="three">
        <!-- 查询条件 -->
        <el-form :inline="true" class="tableSearchBox" size="medium">
          <el-form-item label="片区名称：">
            <el-input v-model="search2.name" placeholder="请输入片区名称" clearable></el-input>
          </el-form-item>
          <el-form-item>
            <el-button type="primary" icon="el-icon-search" @click="getData">查询</el-button>
          </el-form-item>
          <el-form-item>
            <el-button type="primary" icon="el-icon-plus">新增</el-button>
          </el-form-item>
        </el-form>
        <!-- /查询条件 -->
        <PagesTable :tableHeader="tableHeader2" :tableData="tableData2" :tableOperation="tableOperation2"
          :tablePagination="tablePagination2" @pageSize="pageSizeChange2" @currentPage="currentPageChange2"
          @pageOperation="handlePageOperation2" />
      </el-tab-pane>

    </el-tabs>

    <!-- 新增修改  小区 -->
    <el-dialog :title="isAddVillage?'添加小区':'修改小区'" :visible.sync="addVillageVisible" width="500px">
      <el-form :model="villageForm" label-width="95px" class="sanfan-form">
        <el-form-item label="小区名称" class="must">
          <el-input v-model="villageForm.villageName"></el-input>
        </el-form-item>
        <el-form-item label="户数" class="must">
          <el-input v-model="villageForm.villagePeopleNum"></el-input>
        </el-form-item>
        <!-- <el-form-item label="抄表员" class="must">
          <el-checkbox-group  v-model="villageForm_meterReader">
            <el-checkbox v-for="(item,index) in meterReaderList" :key="index" :label="item.meterReaderID">{{item.name}}</el-checkbox>
          </el-checkbox-group>
        </el-form-item> -->
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="addVillageVisible = false">取 消</el-button>
        <el-button type="primary" @click="addVillage">确 定</el-button>
      </div>
    </el-dialog>
    <!-- /新增修改  小区 -->
  </div>
</template>

<script>
  import PagesTable from "../../components/PagesTable.vue";
  import regionalSetting from "./regionalSetting2.vue";
  export default {
    components: {
      PagesTable,
      regionalSetting
    },
    data() {
      return {
        activeName: "two",
        search: {
          villageName: ""
        },
        tableHeader: [{
            name: "序号",
            mark: "index",
            minWidth: "90"
          },
          {
            name: "小区编号",
            mark: "villageID",
            minWidth: "90"
          }, {
            name: "小区名称",
            mark: "volumeName",
            minWidth: "90"
          },
          {
            name: "户数",
            mark: "meterUserNum",
            minWidth: "90"
          },
          // {
          //   name: "添加时间",
          //   mark: "createTime",
          //   minWidth: "90"
          // },
          {
            name: "操作",
            mark: "",
            minWidth: "90"
          },
        ],
        tableOperation: [{
            name: "编辑",
            mark: "edit",
            icon: true
          },
          {
            name: "删除",
            mark: "delete",
            icon: true
          },
        ],
        tablePagination: {
          show: true,
          current: 1,
          size: 10,
          total: 1
        },
        tableData: [],
        tableDataAll: [],
        tableDataSearch: [],
        isAddVillage: true,
        addVillageVisible: false,
        villageForm: {
          villageName: "",
          // meterReader: [],
          villagePeopleNum: "",
          createTime: "",
        },
        meterReaderList: [{
            name: "白明常"
          },
          {
            name: "吴春德"
          },
          {
            name: "田建功"
          }
        ],
        // villageForm_meterReader:[],
        //tab2
        search2: {
          name: ""
        },
        tableHeader2: [{
            name: "序号",
            mark: "no",
            minWidth: "90"
          },
          {
            name: "片区编号",
            mark: "id",
            minWidth: "90"
          }, {
            name: "片区名称",
            mark: "name",
            minWidth: "90"
          },
          {
            name: "操作",
            mark: "",
            minWidth: "90"
          },
        ],
        tableOperation2: [{
            name: "编辑",
            mark: "edit",
            icon: true
          },
          {
            name: "删除",
            mark: "delete",
            icon: true
          },
        ],
        tablePagination2: {
          show: true,
          current: 1,
          size: 10,
          total: 1
        },
        tableData2: [],
        //other
      }
    },
    mounted() {
      this.getData()

      this.tableData2=[{
        no:1,id:1921,name:"阳光区"
      },{
        no:2,id:1922,name:"万柏林区1"
      },{
        no:3,id:1923,name:"万柏林区2"
      }]
    },
    beforeDestroy() {},
    created() {},
    methods: {
      getData() {
        // this.getMeterReader()
        this.getVillage()
      },
      handleTableData() {
        const self = this;
        self.tableData = [];
        let i = (self.tablePagination.current - 1) * self.tablePagination.size;
        let j = self.tablePagination.current * self.tablePagination.size;
        if (j > self.tablePagination.total) {
          j = self.tablePagination.total;
        }
        for (i; i < j; i++) {
          self.tableData.push(self.tableDataSearch[i]);
        }
      },
      pageSizeChange(data) {
        this.tablePagination.size = data;
        this.handleTableData();
      },
      currentPageChange(data) {
        this.tablePagination.current = data;
        this.handleTableData();
      },
      handlePageOperation(row, mark) {
        const self = this;
        if (mark == "edit") {
          self.addVillageVisible = true;
          self.isAddVillage = false;

          //给表单赋值......
          self.villageForm.villageID = row.villageID
          self.villageForm.villageName = row.villageName
          self.villageForm.villagePeopleNum = row.villagePeopleNum
          // var ids_s=row.meterReaderID.split(",");
          // var ids=[]
          // ids_s.forEach(element => {
          //   ids.push(Number(element));
          // });
          // self.villageForm_meterReader=ids
          // self.villageForm_meterReader=row.meterReaderID
        } else if (mark == "delete") {
          this.$confirm('确定要删除此记录吗?', '提示', {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning'
          }).then(() => {
            this.delectCommunityById(row.villageID);
          }).catch(() => {});
        }
      },
      delectCommunityById(id) { //删除小区
        const self = this;
        var param = {
          villageID: id
        };
        self.$axios.post("/service/bsVillageDel", param).then(res => {
          if (res.data.status === "success") {
            self.$message(res.data.res);
            self.getVillage();
          } else {
            self.$message(res.data.res);
          }
        });
      },
      getData2() {},
      pageSizeChange2(data) {
        const self = this
        self.tablePagination2.size = data
        self.getData2()
      },
      currentPageChange2(data) {
        const self = this
        self.tablePagination2.current = data
        self.getData2()
      },
      handlePageOperation2(row, mark) {
        const self = this;
        if (mark == "edit") {
          self.addVillageVisible = true;
          self.isAddVillage = false;

          //给表单赋值......


        } else if (mark == "delete") {
          this.$confirm('确定要删除此记录吗?', '提示', {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning'
          }).then(() => {
            this.delectAreaById(row.id);
          }).catch(() => {});
        }
      },
      delectAreaById(id) { //删除片区
      },
      addVillage() { // 添加小区
        const self = this;
        if (!self.villageForm.villageName ||
          // !self.villageForm_meterReader ||
          !self.villageForm.villagePeopleNum
        ) {
          self.$message.error("标星号为必填！");
          return false
        }
        var param = {
          villageName: self.villageForm.villageName,
          villagePeopleNum: self.villageForm.villagePeopleNum,
          // meterReader: self.villageForm_meterReader.toString(),
        };

        if (self.isAddVillage) {
          //新增
          self.$axios.post("/service/bsVillageAdd", param).then(res => {
            if (res.data.status === "success") {
              self.$message.success(res.data.res);
              self.getVillage();
              self.addVillageVisible = false
            } else {
              self.$message.error(res.data.res);
            }
          });
        } else {
          // 修改
          param.villageID = self.villageForm.villageID
          self.$axios.post("/service/bsVillageMod", param).then(res => {
            if (res.data.status === "success") {
              self.$message.success(res.data.res);
              self.getVillage();
              self.addVillageVisible = false
            } else {
              self.$message.error(res.data.res);
            }
          });
        }
      },
      getVillage() { //获取所有小区
        const self = this;
        var param = {
          villageName: self.search.villageName,
          // pageNum: self.tablePagination.current, //页码
          // pageSize: self.tablePagination.size, //条数
        }

        // self.$axios.post("/service/bsVillageGet", param).then(res => {
        //   if (res.data.status === "success") {
        var tmp = [{
            "name": "\u6155\u4e07\u519b",
            "villageID": 10,
            "suid": 5,
            "volumeName": "\u6c34\u6ce5\u5382\u5bbf\u820d",
            "volumeID": 10,
            "volumeMk": "",
            "volumeCreateTime": "2019-07-09 00:00:00",
            "meterUserNum": 74
          },
          {
            "name": "\u6155\u4e07\u519b",
            "villageID": 11,
            "suid": 5,
            "volumeName": "\u94c1\u5382\u65e7\u5bbf\u820d",
            "volumeID": 11,
            "volumeMk": "",
            "volumeCreateTime": "2013-09-02 00:00:00",
            "meterUserNum": 63
          },
          {
            "name": "\u6155\u4e07\u519b",
            "villageID": 12,
            "suid": 5,
            "volumeName": "\u4e1c\u5317\u8857",
            "volumeID": 12,
            "volumeMk": "",
            "volumeCreateTime": "2014-12-26 00:00:00",
            "meterUserNum": 119
          },
          {
            "name": "\u6155\u4e07\u519b",
            "villageID": 13,
            "suid": 5,
            "volumeName": "\u7cbe\u795e\u75c5\u9662\u5bbf\u820d",
            "volumeID": 13,
            "volumeMk": "",
            "volumeCreateTime": "2013-09-02 00:00:00",
            "meterUserNum": 23
          },
          {
            "name": "\u6155\u4e07\u519b",
            "villageID": 14,
            "suid": 5,
            "volumeName": "\u7535\u4e1a\u5c40\u5bbf\u820d",
            "volumeID": 14,
            "volumeMk": "",
            "volumeCreateTime": "2013-09-02 00:00:00",
            "meterUserNum": 15
          },
          {
            "name": "\u6155\u4e07\u519b",
            "villageID": 15,
            "suid": 5,
            "volumeName": "\u536b\u6821",
            "volumeID": 15,
            "volumeMk": "",
            "volumeCreateTime": "2013-09-02 00:00:00",
            "meterUserNum": 6
          },
          {
            "name": "\u6155\u4e07\u519b",
            "villageID": 16,
            "suid": 5,
            "volumeName": "\u5317\u683c\u5df7",
            "volumeID": 16,
            "volumeMk": "",
            "volumeCreateTime": "2013-09-02 00:00:00",
            "meterUserNum": 414
          },
          {
            "name": "\u6155\u4e07\u519b",
            "villageID": 17,
            "suid": 5,
            "volumeName": "\u7ea2\u697c",
            "volumeID": 17,
            "volumeMk": "",
            "volumeCreateTime": "2013-09-02 00:00:00",
            "meterUserNum": 24
          },
          {
            "name": "\u6155\u4e07\u519b",
            "villageID": 18,
            "suid": 5,
            "volumeName": "\u5de5\u7a0b\u961f\u5bbf\u820d",
            "volumeID": 18,
            "volumeMk": "",
            "volumeCreateTime": "2013-09-02 00:00:00",
            "meterUserNum": 62
          },
          {
            "name": "\u6155\u4e07\u519b",
            "villageID": 19,
            "suid": 5,
            "volumeName": "\u5317\u90d1\u6751",
            "volumeID": 19,
            "volumeMk": "",
            "volumeCreateTime": "2013-09-02 00:00:00",
            "meterUserNum": 559
          },
          {
            "name": "\u6155\u4e07\u519b",
            "villageID": 20,
            "suid": 5,
            "volumeName": "\u5916\u8d38\u5bbf\u820d",
            "volumeID": 20,
            "volumeMk": "",
            "volumeCreateTime": "2013-09-02 00:00:00",
            "meterUserNum": 59
          },
          {
            "name": "\u6155\u4e07\u519b",
            "villageID": 21,
            "suid": 5,
            "volumeName": "\u84c4\u7267\u5c40\u5bbf\u820d",
            "volumeID": 21,
            "volumeMk": "",
            "volumeCreateTime": "2013-09-02 00:00:00",
            "meterUserNum": 56
          },
          {
            "name": "\u6155\u4e07\u519b",
            "villageID": 22,
            "suid": 5,
            "volumeName": "\u603b\u8868\uff08\u6155\uff09",
            "volumeID": 22,
            "volumeMk": "",
            "volumeCreateTime": "2013-09-02 00:00:00",
            "meterUserNum": 12
          },
          {
            "name": "\u6155\u4e07\u519b",
            "villageID": 23,
            "suid": 5,
            "volumeName": "\u53cc\u6c9f",
            "volumeID": 23,
            "volumeMk": "",
            "volumeCreateTime": "2014-12-26 00:00:00",
            "meterUserNum": 20
          },
          {
            "name": "\u6155\u4e07\u519b",
            "villageID": 24,
            "suid": 5,
            "volumeName": "\u9ec4\u4e1c\u8def",
            "volumeID": 24,
            "volumeMk": "",
            "volumeCreateTime": "2015-08-06 00:00:00",
            "meterUserNum": 4
          },
          {
            "name": "\u6155\u4e07\u519b",
            "villageID": 25,
            "suid": 5,
            "volumeName": "\u77f3\u6cb9\u516c\u53f8\u5bbf\u820d",
            "volumeID": 25,
            "volumeMk": "",
            "volumeCreateTime": "2015-09-24 00:00:00",
            "meterUserNum": 19
          },
          {
            "name": "\u6155\u4e07\u519b",
            "villageID": 26,
            "suid": 5,
            "volumeName": "\u624b\u673a\u6284\u8868\u5e55",
            "volumeID": 26,
            "volumeMk": "",
            "volumeCreateTime": "2019-12-20 09:46:07",
            "meterUserNum": 50
          },
          {
            "name": "\u6155\u4e07\u519b",
            "villageID": 27,
            "suid": 5,
            "volumeName": "314\u7701\u9053",
            "volumeID": 27,
            "volumeMk": "",
            "volumeCreateTime": "2020-03-31 00:00:00",
            "meterUserNum": 11
          },
          {
            "name": "\u5434\u6625\u5fb7",
            "villageID": 28,
            "suid": 7,
            "volumeName": "\u65b0\u534e\u5df7",
            "volumeID": 28,
            "volumeMk": "",
            "volumeCreateTime": "2013-09-02 00:00:00",
            "meterUserNum": 0
          },
          {
            "name": "\u5434\u6625\u5fb7",
            "villageID": 29,
            "suid": 7,
            "volumeName": "\u671d\u9633\u8def\u4e1c",
            "volumeID": 29,
            "volumeMk": "",
            "volumeCreateTime": "2013-09-02 00:00:00",
            "meterUserNum": 155
          },
          {
            "name": "\u767d\u660e\u5e38",
            "villageID": 30,
            "suid": 9,
            "volumeName": "\u53bf\u793e\u5bbf\u820d",
            "volumeID": 30,
            "volumeMk": "",
            "volumeCreateTime": "2013-09-02 00:00:00",
            "meterUserNum": 21
          },
          {
            "name": "\u767d\u660e\u5e38",
            "villageID": 31,
            "suid": 9,
            "volumeName": "\u5546\u8d38\u8857",
            "volumeID": 31,
            "volumeMk": "",
            "volumeCreateTime": "2013-09-02 00:00:00",
            "meterUserNum": 83
          },
          {
            "name": "\u5434\u6625\u5fb7",
            "villageID": 32,
            "suid": 7,
            "volumeName": "\u671d\u9633\u8def\u897f",
            "volumeID": 32,
            "volumeMk": "",
            "volumeCreateTime": "2013-09-02 00:00:00",
            "meterUserNum": 155
          },
          {
            "name": "\u5434\u6625\u5fb7",
            "villageID": 33,
            "suid": 7,
            "volumeName": "\u515a\u6821\u540e",
            "volumeID": 33,
            "volumeMk": "",
            "volumeCreateTime": "2013-09-02 00:00:00",
            "meterUserNum": 99
          },
          {
            "name": "\u5434\u6625\u5fb7",
            "villageID": 34,
            "suid": 7,
            "volumeName": "\u9e33\u9e2f\u697c",
            "volumeID": 34,
            "volumeMk": "",
            "volumeCreateTime": "2013-09-02 00:00:00",
            "meterUserNum": 229
          },
          {
            "name": "\u5434\u6625\u5fb7",
            "villageID": 35,
            "suid": 7,
            "volumeName": "\u4eba\u5927\u5355\u5143\u697c",
            "volumeID": 35,
            "volumeMk": "",
            "volumeCreateTime": "2013-09-02 00:00:00",
            "meterUserNum": 60
          },
          {
            "name": "\u5434\u6625\u5fb7",
            "villageID": 36,
            "suid": 7,
            "volumeName": "\u8001\u5e72\u90e8\u5355\u5143\u697c",
            "volumeID": 36,
            "volumeMk": "",
            "volumeCreateTime": "2013-09-02 00:00:00",
            "meterUserNum": 60
          },
          {
            "name": "\u6155\u4e07\u519b",
            "villageID": 37,
            "suid": 5,
            "volumeName": "\u6797\u5de5\u5546\u5bbf\u820d",
            "volumeID": 37,
            "volumeMk": "",
            "volumeCreateTime": "2019-07-09 00:00:00",
            "meterUserNum": 44
          },
          {
            "name": "\u5434\u6625\u5fb7",
            "villageID": 38,
            "suid": 7,
            "volumeName": "\u6c34\u6cc9\u5d16",
            "volumeID": 38,
            "volumeMk": "",
            "volumeCreateTime": "2019-07-09 00:00:00",
            "meterUserNum": 126
          },
          {
            "name": "\u767d\u660e\u5e38",
            "villageID": 39,
            "suid": 9,
            "volumeName": "\u53bf\u793e\u5c0f\u4e8c\u697c",
            "volumeID": 39,
            "volumeMk": "",
            "volumeCreateTime": "2019-07-09 00:00:00",
            "meterUserNum": 23
          },
          {
            "name": "\u5434\u6625\u5fb7",
            "villageID": 40,
            "suid": 7,
            "volumeName": "\u6c11\u653f\u5c40\u5bbf\u820d",
            "volumeID": 40,
            "volumeMk": "",
            "volumeCreateTime": "2013-09-02 00:00:00",
            "meterUserNum": 1
          },
          {
            "name": "\u5434\u6625\u5fb7",
            "villageID": 41,
            "suid": 7,
            "volumeName": "\u603b\u8868\uff08\u5434\uff09",
            "volumeID": 41,
            "volumeMk": "",
            "volumeCreateTime": "2013-09-02 00:00:00",
            "meterUserNum": 17
          },
          {
            "name": "\u5434\u6625\u5fb7",
            "villageID": 42,
            "suid": 7,
            "volumeName": "\u5bcc\u5eb7\u5bb6\u56ed",
            "volumeID": 42,
            "volumeMk": "",
            "volumeCreateTime": "2013-09-02 00:00:00",
            "meterUserNum": 642
          },
          {
            "name": "\u767d\u660e\u5e38",
            "villageID": 43,
            "suid": 9,
            "volumeName": "\u571f\u5730\u5c40\u8def\u5317",
            "volumeID": 43,
            "volumeMk": "",
            "volumeCreateTime": "2019-07-09 00:00:00",
            "meterUserNum": 44
          },
          {
            "name": "\u767d\u660e\u5e38",
            "villageID": 44,
            "suid": 9,
            "volumeName": "\u5927\u8fd0\u8def\u4ea4\u901a\u5927\u697c\u5317",
            "volumeID": 44,
            "volumeMk": "",
            "volumeCreateTime": "2019-07-09 00:00:00",
            "meterUserNum": 29
          },
          {
            "name": "\u5434\u6625\u5fb7",
            "villageID": 45,
            "suid": 7,
            "volumeName": "\u6559\u59d4\u5355\u5143\u697c",
            "volumeID": 45,
            "volumeMk": "",
            "volumeCreateTime": "2020-04-27 00:00:00",
            "meterUserNum": 0
          },
          {
            "name": "\u767d\u6c38\u65b0",
            "villageID": 46,
            "suid": 8,
            "volumeName": "\u519c\u4e1a\u5c40\u5bbf\u820d",
            "volumeID": 46,
            "volumeMk": "",
            "volumeCreateTime": "2014-12-26 00:00:00",
            "meterUserNum": 22
          },
          {
            "name": "\u767d\u6c38\u65b0",
            "villageID": 47,
            "suid": 8,
            "volumeName": "\u8001\u5e72\u5c40\u5bbf\u820d",
            "volumeID": 47,
            "volumeMk": "",
            "volumeCreateTime": "2014-12-26 00:00:00",
            "meterUserNum": 39
          },
          {
            "name": "\u767d\u6c38\u65b0",
            "villageID": 48,
            "suid": 8,
            "volumeName": "\u7535\u5f71\u9662\u5bbf\u820d",
            "volumeID": 48,
            "volumeMk": "",
            "volumeCreateTime": "2014-12-26 00:00:00",
            "meterUserNum": 9
          },
          {
            "name": "\u767d\u6c38\u65b0",
            "villageID": 49,
            "suid": 8,
            "volumeName": "\u77f3\u6cb9\u767e\u8d27\u5bbf\u820d",
            "volumeID": 49,
            "volumeMk": "",
            "volumeCreateTime": "2014-12-26 00:00:00",
            "meterUserNum": 17
          },
          {
            "name": "\u767d\u6c38\u65b0",
            "villageID": 50,
            "suid": 8,
            "volumeName": "\u519c\u884c\u5bbf\u820d\u897f",
            "volumeID": 50,
            "volumeMk": "",
            "volumeCreateTime": "2014-12-26 00:00:00",
            "meterUserNum": 22
          },
          {
            "name": "\u767d\u6c38\u65b0",
            "villageID": 51,
            "suid": 8,
            "volumeName": "\u52b3\u52a8\u5c40\u5bbf\u820d",
            "volumeID": 51,
            "volumeMk": "",
            "volumeCreateTime": "2014-12-26 00:00:00",
            "meterUserNum": 12
          },
          {
            "name": "\u767d\u660e\u5e38",
            "villageID": 52,
            "suid": 9,
            "volumeName": "\u8ba1\u59d4",
            "volumeID": 52,
            "volumeMk": "",
            "volumeCreateTime": "2019-07-09 00:00:00",
            "meterUserNum": 15
          },
          {
            "name": "\u767d\u6c38\u65b0",
            "villageID": 53,
            "suid": 8,
            "volumeName": "\u5de5\u4f1a",
            "volumeID": 53,
            "volumeMk": "",
            "volumeCreateTime": "2014-12-26 00:00:00",
            "meterUserNum": 12
          },
          {
            "name": "\u767d\u6c38\u65b0",
            "villageID": 54,
            "suid": 8,
            "volumeName": "\u7a0e\u52a1\u5c40\u5355\u5143\u697c",
            "volumeID": 54,
            "volumeMk": "",
            "volumeCreateTime": "2014-12-26 00:00:00",
            "meterUserNum": 47
          },
          {
            "name": "\u767d\u6c38\u65b0",
            "villageID": 55,
            "suid": 8,
            "volumeName": "\u57ce\u5efa\u5c0f\u4e8c\u697c",
            "volumeID": 55,
            "volumeMk": "",
            "volumeCreateTime": "2014-12-26 00:00:00",
            "meterUserNum": 0
          },
          {
            "name": "\u767d\u6c38\u65b0",
            "villageID": 56,
            "suid": 8,
            "volumeName": "\u5de5\u884c\u5bbf\u820d",
            "volumeID": 56,
            "volumeMk": "",
            "volumeCreateTime": "2014-12-26 00:00:00",
            "meterUserNum": 15
          },
          {
            "name": "\u767d\u6c38\u65b0",
            "villageID": 57,
            "suid": 8,
            "volumeName": "\u4e2d\u5357\u6d77",
            "volumeID": 57,
            "volumeMk": "",
            "volumeCreateTime": "2014-12-26 00:00:00",
            "meterUserNum": 187
          },
          {
            "name": "\u767d\u6c38\u65b0",
            "villageID": 58,
            "suid": 8,
            "volumeName": "\u5de5\u884c\u5355\u5143\u697c\uff08\u897f\uff09",
            "volumeID": 58,
            "volumeMk": "",
            "volumeCreateTime": "2014-12-26 00:00:00",
            "meterUserNum": 32
          },
          {
            "name": "\u767d\u6c38\u65b0",
            "villageID": 59,
            "suid": 8,
            "volumeName": "\u57ce\u5efa\u56db\u697c",
            "volumeID": 59,
            "volumeMk": "",
            "volumeCreateTime": "2014-12-26 00:00:00",
            "meterUserNum": 36
          },
          {
            "name": "\u767d\u6c38\u65b0",
            "villageID": 60,
            "suid": 8,
            "volumeName": "\u5f00\u53d1\u697c",
            "volumeID": 60,
            "volumeMk": "",
            "volumeCreateTime": "2014-12-26 00:00:00",
            "meterUserNum": 108
          },
          {
            "name": "\u767d\u6c38\u65b0",
            "villageID": 61,
            "suid": 8,
            "volumeName": "\u9505\u697c\u623f\u540e\u4e8c\u697c",
            "volumeID": 61,
            "volumeMk": "",
            "volumeCreateTime": "2014-12-26 00:00:00",
            "meterUserNum": 14
          },
          {
            "name": "\u767d\u6c38\u65b0",
            "villageID": 62,
            "suid": 8,
            "volumeName": "\u8d22\u653f\u5c40\u897f",
            "volumeID": 62,
            "volumeMk": "",
            "volumeCreateTime": "2014-12-30 00:00:00",
            "meterUserNum": 222
          },
          {
            "name": "\u767d\u6c38\u65b0",
            "villageID": 63,
            "suid": 8,
            "volumeName": "\u77f3\u818f\u5382\u540e",
            "volumeID": 63,
            "volumeMk": "",
            "volumeCreateTime": "2014-12-26 00:00:00",
            "meterUserNum": 158
          },
          {
            "name": "\u767d\u6c38\u65b0",
            "villageID": 64,
            "suid": 8,
            "volumeName": "\u8d22\u653f\u5c40\u8def\u5317",
            "volumeID": 64,
            "volumeMk": "",
            "volumeCreateTime": "2014-12-26 00:00:00",
            "meterUserNum": 178
          },
          {
            "name": "\u767d\u6c38\u65b0",
            "villageID": 65,
            "suid": 8,
            "volumeName": "\u603b\u8868\uff08\u4e8c\u5c0f\uff09",
            "volumeID": 65,
            "volumeMk": "",
            "volumeCreateTime": "2014-12-26 00:00:00",
            "meterUserNum": 25
          },
          {
            "name": "\u6155\u4e07\u519b",
            "villageID": 66,
            "suid": 5,
            "volumeName": "\u4e94\u4ea4\u5316\u4e2d\u5355\u5143",
            "volumeID": 66,
            "volumeMk": "",
            "volumeCreateTime": "2019-07-09 00:00:00",
            "meterUserNum": 8
          },
          {
            "name": "\u767d\u660e\u5e38",
            "villageID": 67,
            "suid": 9,
            "volumeName": "\u836f\u6750\u516c\u53f8\u5355\u5143\u697c",
            "volumeID": 67,
            "volumeMk": "",
            "volumeCreateTime": "2019-07-09 00:00:00",
            "meterUserNum": 50
          },
          {
            "name": "\u6155\u4e07\u519b",
            "villageID": 68,
            "suid": 5,
            "volumeName": "\u94c1\u5382\u5c0f\u4e8c\u697c",
            "volumeID": 68,
            "volumeMk": "",
            "volumeCreateTime": "2019-07-09 00:00:00",
            "meterUserNum": 29
          },
          {
            "name": "\u767d\u660e\u5e38",
            "villageID": 69,
            "suid": 9,
            "volumeName": "\u4e3d\u9633\u5c0f\u533a",
            "volumeID": 69,
            "volumeMk": "",
            "volumeCreateTime": "2019-07-09 00:00:00",
            "meterUserNum": 49
          },
          {
            "name": "\u767d\u6c38\u65b0",
            "villageID": 70,
            "suid": 8,
            "volumeName": "\u9632\u75ab\u7ad9\u5355\u5143\u697c",
            "volumeID": 70,
            "volumeMk": "",
            "volumeCreateTime": "2014-12-26 00:00:00",
            "meterUserNum": 43
          },
          {
            "name": "\u6155\u4e07\u519b",
            "villageID": 71,
            "suid": 5,
            "volumeName": "\u4e94\u4ea4\u5316\u5355\u5143\u697c",
            "volumeID": 71,
            "volumeMk": "",
            "volumeCreateTime": "2019-07-09 00:00:00",
            "meterUserNum": 78
          },
          {
            "name": "\u767d\u6c38\u65b0",
            "villageID": 72,
            "suid": 8,
            "volumeName": "\u571f\u5730\u5c40\u8def\u5357",
            "volumeID": 72,
            "volumeMk": "",
            "volumeCreateTime": "2014-12-26 00:00:00",
            "meterUserNum": 62
          },
          {
            "name": "\u767d\u6c38\u65b0",
            "villageID": 73,
            "suid": 8,
            "volumeName": "\u5927\u8fd0\u8def\u4ea4\u901a\u5927\u697c\u5357",
            "volumeID": 73,
            "volumeMk": "",
            "volumeCreateTime": "2014-12-26 00:00:00",
            "meterUserNum": 64
          },
          {
            "name": "\u767d\u6c38\u65b0",
            "villageID": 74,
            "suid": 8,
            "volumeName": "\u6559\u59d4\u5bbf\u820d",
            "volumeID": 74,
            "volumeMk": "",
            "volumeCreateTime": "2017-04-05 09:21:26",
            "meterUserNum": 23
          },
          {
            "name": "\u767d\u6c38\u65b0",
            "villageID": 75,
            "suid": 8,
            "volumeName": "\u5317\u5854\u5730\u65b0\u6751",
            "volumeID": 75,
            "volumeMk": "",
            "volumeCreateTime": "2020-04-29 00:00:00",
            "meterUserNum": 291
          },
          {
            "name": "\u767d\u6c38\u65b0",
            "villageID": 76,
            "suid": 8,
            "volumeName": "\u805a\u4e30\u82d1",
            "volumeID": 76,
            "volumeMk": "",
            "volumeCreateTime": "2020-04-27 00:00:00",
            "meterUserNum": 208
          },
          {
            "name": "\u767d\u660e\u5e38",
            "villageID": 77,
            "suid": 9,
            "volumeName": "\u65b0\u534e\u4e66\u5e97\u5bbf\u820d",
            "volumeID": 77,
            "volumeMk": "",
            "volumeCreateTime": "2020-04-27 00:00:00",
            "meterUserNum": 9
          },
          {
            "name": "\u767d\u660e\u5e38",
            "villageID": 78,
            "suid": 9,
            "volumeName": "\u852c\u83dc\u516c\u53f8\u5bbf\u820d",
            "volumeID": 78,
            "volumeMk": "",
            "volumeCreateTime": "2020-04-27 00:00:00",
            "meterUserNum": 11
          },
          {
            "name": "\u767d\u660e\u5e38",
            "villageID": 79,
            "suid": 9,
            "volumeName": "\u50a8\u5907\u5e93\u5bbf\u820d",
            "volumeID": 79,
            "volumeMk": "",
            "volumeCreateTime": "2020-04-27 00:00:00",
            "meterUserNum": 24
          },
          {
            "name": "\u767d\u660e\u5e38",
            "villageID": 80,
            "suid": 9,
            "volumeName": "\u767e\u5bb6\u5df7",
            "volumeID": 80,
            "volumeMk": "",
            "volumeCreateTime": "2020-04-27 00:00:00",
            "meterUserNum": 97
          },
          {
            "name": "\u767d\u660e\u5e38",
            "villageID": 81,
            "suid": 9,
            "volumeName": "\u5de5\u884c\u5355\u5143\u697c\uff08\u4e1c\uff09",
            "volumeID": 81,
            "volumeMk": "",
            "volumeCreateTime": "2020-04-27 00:00:00",
            "meterUserNum": 61
          },
          {
            "name": "\u767d\u660e\u5e38",
            "villageID": 82,
            "suid": 9,
            "volumeName": "\u6021\u6b23\u56ed\u5c0f\u533a",
            "volumeID": 82,
            "volumeMk": "",
            "volumeCreateTime": "2020-04-27 00:00:00",
            "meterUserNum": 396
          },
          {
            "name": "\u767d\u660e\u5e38",
            "villageID": 83,
            "suid": 9,
            "volumeName": "\u7279\u94a2\u5bbf\u820d",
            "volumeID": 83,
            "volumeMk": "",
            "volumeCreateTime": "2020-04-27 00:00:00",
            "meterUserNum": 6
          },
          {
            "name": "\u767d\u660e\u5e38",
            "villageID": 84,
            "suid": 9,
            "volumeName": "\u6587\u5316\u5c40\u5bbf\u820d",
            "volumeID": 84,
            "volumeMk": "",
            "volumeCreateTime": "2020-04-27 00:00:00",
            "meterUserNum": 16
          }
        ]
        tmp.forEach((element, index) => {
          element.index = index + self.tablePagination.size * self.tablePagination.current - self
            .tablePagination.size + 1
        });
        self.tableDataAll = tmp;
        self.tableDataSearch = self.tableDataAll;
        self.tablePagination.total = tmp.length
        self.handleTableData();
        //   } else {
        //     self.$message.error(res.data.res);
        //   }
        // });
      },
      clearFormInfo() { //新增时清空表单
        this.villageForm = {
          villageName: "",
          // meterReader: "",
          villagePeopleNum: "",
          createTime: "",
        }
        // this.villageForm_meterReader=[]
        // this.deviceTypeForm = {
        //   meterTypeID: "",
        //   meterTypeName: "",
        //   supplier: "",
        // }
      },
      async getMeterReader() { //抄表员
        const self = this;
        var param = {
          rid: 3
        }
        self.$axios.post("/service/bsMeterReaderGet", param).then(res => {
          if (res.data.status === "success") {
            self.meterReaderList = res.data.res
          } else {
            self.$message(res.data.res);
          }
        });
      },
    }
  }
</script>
<style lang="scss" scoped>

</style>